package io.github.javpower.imagerex.model;

import io.github.javpower.vectorex.keynote.model.MetricType;
import io.github.javpower.vectorexcore.annotation.VectoRexCollection;
import io.github.javpower.vectorexcore.annotation.VectoRexField;
import io.github.javpower.vectorexcore.entity.DataType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@VectoRexCollection(name = "image")
@AllArgsConstructor
@NoArgsConstructor
public class Image {
    @VectoRexField(
            isPrimaryKey = true
    )
    private String name;//图片名称

    @VectoRexField
    private String image;//图片 base64

    @VectoRexField(
            name = "vector", // 字段名称
            dataType = DataType.FloatVector,
            dimension = 4096,// 向量维度
            metricType = MetricType.FLOAT_COSINE_DISTANCE
    )
    private List<Float> vector; //调用FeatureExtractor内方法转成的数据


}